package com.shop;

import com.shop.interceptor.FeignInterceptor;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.context.annotation.Bean;
import org.springframework.scheduling.annotation.EnableScheduling;

@SpringBootApplication
@EnableDiscoveryClient
@MapperScan("com.shop.mapper")
@EnableFeignClients(basePackages = {"com.shop.feign", "com.shop.alipay.feign"})
@EnableScheduling  //开启定时任务
public class OrderApplication {
    public static void main(String[] args) {
        SpringApplication.run(OrderApplication.class, args);
    }

    @Bean //拦截器
    public FeignInterceptor feignInterceptor() {
        return new FeignInterceptor();
    }
}